package com.demo.samples.task;


import com.demo.samples.config.TestConfigProperties;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class TestTask {

    // private static String name;
    private final TestConfigProperties testConfigProperties;

    public TestTask(TestConfigProperties testConfigProperties) {
        this.testConfigProperties = testConfigProperties;
    }

    // @Value("${laowei.name}")
    // public void setName(String name) {
    //     TestTask.name = name;
    // }

    @Scheduled(cron = "0/1 * * * * ? ")
    public void test() {
        System.out.println(testConfigProperties.getName());
    }
}
